<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */

namespace App\Config\Service;

use App\Config\Mapper\ConfigProductMapper;
use Mine\Abstracts\AbstractService;

/**
 * 饰品列表服务类
 */
class ConfigProductService extends AbstractService
{
    /**
     * @var ConfigProductMapper
     */
    public $mapper;

    public function __construct(ConfigProductMapper $mapper)
    {
        $this->mapper = $mapper;
    }

    /**
     * 通过 id 列表获取用户基础信息.
     */
    public function getByIds(array $ids): array
    {
        return $this->mapper->getByIds($ids);
    }

    public function getZbtPageList(?array $params = null, bool $isScope = true): array
    {
        if ($params['select'] ?? null) {
            $params['select'] = explode(',', $params['select']);
        }
        return $this->mapper->getZbtPageList($params, $isScope);
    }
}